<template>
  <div id="app">
    <!-- <h2 id="title" ref="title">茉莉花</h2>
    <User id="user" ref="user"></User>
    <button @click="getDom">获取Dom元素</button>
    <Student :name="name" :age="age" :grade="grade" :cls="cls" @up="updateName" ref="student"></Student> -->
    <Notepad></Notepad>
  </div>
 
</template>

<script>
import User from "./components/User.vue";
import Student from "./components/Student.vue";
import Notepad from "./components/Notepad.vue";

export default {
  name: "App",
  components: {
    User,
    Student,
    Notepad,
  },
  data() 
  {
    return{
      name:"梨花",
      grade:"M7s",
      age:18,
      cls:"高三",
      
    };
  },
  methods: {
    getDom() {
      console.log(document.getElementById("user"));
      // console.log(this.$refs.title);

      console.log("----------------------------------------------");
      
      console.log(this.$refs.user);
      console.log(this.$refs.user.name);
      console.log(this.$refs.user.show());

      this.$refs.student.$on('c');

    },
    updateName(sname,age){
      this.name = sname
      this.age = age
    },
  }
};
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>